//package com.test.simplechat.server;
//
//import io.undertow.Handlers;
//import io.undertow.Undertow;
//import io.undertow.server.handlers.resource.PathResourceManager;
//import org.slf4j.Logger;
//import org.slf4j.LoggerFactory;
//import org.springframework.web.context.request.RequestAttributes;
//import org.springframework.web.context.request.RequestContextHolder;
//import org.springframework.web.context.request.ServletRequestAttributes;
//
//import javax.servlet.http.HttpServletRequest;
//import java.io.File;
//
///**
// * @author wen
// *
// * 开启文件服务
// */
//public class FileServer {
//    private final static Logger LOGGER = LoggerFactory.getLogger(FileServer.class);
//
//    private int port;
//
//
//
//    public FileServer(int port) {
//        this.port = port;
//    }
////开启服务
//    public void start() throws Exception {
//        File file = new File("/");
////        RequestAttributes requestAttributes = RequestContextHolder.currentRequestAttributes();
////        HttpServletRequest request = ((ServletRequestAttributes) requestAttributes).getRequest();
//
////        Undertow server = Undertow.builder().addHttpListener(port, "/")
////                .setHandler(Handlers.resource(new PathResourceManager(file.toPath(), 100))
////                        .setDirectoryListingEnabled(true))
////                .build();
////        server.start();
//        LOGGER.debug("fileServer启动");
//    }
//}
